import { createStore, combineReducers} from 'redux';

// reducer 1
function counter(state =0, action) {
  if(action == 'incre'){

    return state + 1;
  }
}

// reducer2

function sum(state = 0, action) {
  return state.reduce((sum, item, index)=>{
    return sum + item;
  })
}

let store = createStore(combineReducers({ counter, sum }));


store.dispatch({
  type: 'incre'
})